﻿using System;
using Ue.Qcdz.Domain.Shops;
namespace Ue.Qcdz.Domain
{
    /// <summary>
    /// 商铺 URL
    /// </summary>
    public partial class SiteUrls
    {
        /// <summary>
        /// 【管理员】管理店铺
        /// </summary>
        /// <returns></returns>
        public string ShopManage()
        {
            return this.BuildUrl("ShopManage", null);
        }
        /// <summary>
        /// 申请开通店铺
        /// </summary>
        /// <returns></returns>
        public string ShopApply()
        {
            //已经开通店铺
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopDescriptionEdit", shop.Key);
            }
            //申请店铺
            return this.BuildUrl("ShopApply", null);
        }
        /// <summary>
        /// 留言
        /// </summary>
        /// <returns></returns>
        public string ShopFeedBack()
        {
            Shop shop = SiteContext.GetSiteContext().Shop;
            if (shop != null)
                return this.BuildUrl("ShopFeedback", shop.Key);
            return null;
        }
        /// <summary>
        /// 店铺商品
        /// </summary>
        /// <returns></returns>
        public string ShopProductInfo()
        {
            Shop shop = SiteContext.GetSiteContext().Shop;
            if (shop != null)
                return this.BuildUrl("ShopProductInfo", shop.Key);
            return null;
        }
        /// <summary>
        /// 基本资料
        /// </summary>
        /// <returns></returns>
        public string ShopDescriptionEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopDescriptionEdit", shop.Key);
            }
            return "#";
        }
        /// <summary>
        /// 联系方式
        /// </summary>
        /// <returns></returns>
        public string ShopContactEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopContactEdit", shop.Key);
            }
            return "#";
        }
        /// <summary>
        /// LOgo编辑
        /// </summary>
        /// <returns></returns>
        public string ShopLogoEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopLogoEdit", shop.Key);
            }
            return "#";
        }
        /// <summary>
        /// Banner编辑
        /// </summary>
        /// <returns></returns>
        public string ShopBannerEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopBannerEdit", shop.Key);
            }
            return "#";
        }
        /// <summary>
        /// 查看留言
        /// </summary>
        /// <returns></returns>
        public string ShopFeekBackView()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopFeekBackView", shop.Key);
            }
            return "#";
        }

        /// <summary>
        /// 暂无
        /// </summary>
        /// <returns></returns>
        public string ShopEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopEdit", shop.Key);
            }
            return "#";
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <returns></returns>
        public string Register()
        {
            return this.BuildUrl("Register");
        }

        /// <summary>
        /// 商铺首页
        /// </summary>
        /// <returns></returns>
        public string ShopHome()
        {
            if (SiteContext.GetSiteContext().Shop != null)
                return this.BuildUrl("ShopHome", SiteContext.GetSiteContext().Shop.Key);
            return string.Empty;
        }
        /// <summary>
        /// 商铺首页
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string ShopHome(object key)
        {
            if (key is Shop)
                return this.BuildUrl("ShopHome", (key as Shop).Key);
            else
                return this.BuildUrl("ShopHome", key);

        }
    }
}
